Global msacmLib:Int = LoadLibraryA( "msacm32" )
If Not msacmLib RuntimeError "Unable to locate ACM"

Global acmDriverClose	:Int 		(had:Int, fdwClose:Int)"win32"=GetProcAddress( msacmLib,"acmDriverClose" )
Global acmDriverDetails:Int 		(hadid:Int, padd:Byte Ptr, fdwDetails:Int)"win32"=GetProcAddress( msacmLib,"acmDriverDetailsA" )
Global acmDriverEnum:Int 			(fnCallback:Byte Ptr, dwInstance:Int, fdwEnum:Int)"win32"=GetProcAddress( msacmLib,"acmDriverEnum" )
Global acmDriverOpen:Int 			(phad:Int Var, hadid:Int, fdwOpen:Int)"win32"=GetProcAddress( msacmLib,"acmDriverOpen" )

Global acmFormatSuggest:Int 		(had:Int, pwfxSrc:Byte Ptr, pwfxDst:Byte Ptr, cbwfxDst:Int, fdwSuggest:Int)"win32"=GetProcAddress( msacmLib,"acmFormatSuggest" )
Global acmFormatTagDetails:Int		(had:Int, paftd:Byte Ptr, fdwDetails:Int)"win32"=GetProcAddress( msacmLib,"acmFormatTagDetailsA" )

Global acmMetrics:Int				(hao:Int, uMetric:Int, pMetric:Int Var)"win32"=GetProcAddress( msacmLib,"acmMetrics" )

Global acmStreamClose:Int			(has:Int, fdwClose:Int)"win32"=GetProcAddress( msacmLib,"acmStreamClose" )
Global acmStreamConvert:Int			(has:Int, pash:Byte Ptr, fdwConvert:Int)"win32"=GetProcAddress( msacmLib,"acmStreamConvert" )
Global acmStreamOpen:Int			(phas:Int Var, had:Int, pwfxSrc:Byte Ptr, pwfxDst:Byte Ptr, pwfltr:Byte Ptr, dwCallback:Int, dwInstance:Int, fdwOpen:Int)"win32"=GetProcAddress( msacmLib,"acmStreamOpen" )
Global acmStreamPrepareHeader:Int	(has:Int, pash:Byte Ptr, fdwPrepare:Int)"win32"=GetProcAddress( msacmLib,"acmStreamPrepareHeader" )
Global acmStreamSize:Int			(has:Int, cbInput:Int, pdwOutputBytes:Int Var, fdwSize:Int)"win32"=GetProcAddress( msacmLib,"acmStreamSize" )
Global acmStreamUnprepareHeader:Int	(has:Int, pash:Byte Ptr, fdwUnprepare:Int)"win32"=GetProcAddress( msacmLib,"acmStreamUnprepareHeader" )

Global acmMaxFormatSize:Int ; acmMetrics( Null, ACM_METRIC_MAX_SIZE_FORMAT, acmMaxFormatSize )

' ----------------------------------------------------------

Type MaxMod_ACM Extends TMusic

	Field File:String
	Field fpIn:TStream
	Field informat:TBank	= CreateBank(acmMaxFormatSize)
	Field outformat:TBank 	= CreateBank(acmMaxFormatSize)
	Field g_stream:Int
	Field streamHead:TBank
	Field inbuf:TBank
	Field outbuf:TBank
	Field Chunksize:Int
	Field ChunkPos:Byte Ptr
	Field BLOCK_SIZE:Int 	= 256
	
	Method StreamOpen:Int()

		' open an ACM conversion stream -----------------------------------------------------------------
		If acmStreamOpen( g_stream, Null, LockBank(informat), LockBank(outFormat), Null, 0, 0, 0) Return False

		' open file -------------------------------------------------------------------------------------
		'fpIn = OpenStream(File$)
		If Not fpIn Then RuntimeError("Unable to open MP3")

		' find out how big the decompressed buffer will be and allocate the buffers ---------------------
		Local rawbufsize:Int
		If acmStreamSize( g_stream, BLOCK_SIZE, rawbufsize, ACM_STREAMSIZEF_SOURCE ) Return False
		inbuf:TBank = CreateBank(BLOCK_SIZE)
		outbuf:TBank = CreateBank(rawbufsize)
	
		' prepare the decoder ---------------------------------------------------------------------------
		streamHead:TBank = CreateBank(100)
		PokeInt	(streamHead, 0,  100)					'cbStruct	
		PokeInt	(streamHead, 4,  0)						'fdwStatus	
		PokeInt	(streamHead, 8,  0)						'dwUser	
		PokeInt	(streamHead, 12, Int(BankBuf(inbuf)) )	'pbSrc	
		PokeInt	(streamHead, 16, BLOCK_SIZE)			'cbSrcLength
		PokeInt	(streamHead, 20, 0)						'cbSrcLengthUsed
		PokeInt	(streamHead, 24, 0)						'dwSrcUser
		PokeInt	(streamHead, 28, Int(BankBuf(outbuf)))	'pbDst
		PokeInt	(streamHead, 32, rawbufsize)			'cbDstLength
		PokeInt	(streamHead, 36, 0)						'cbDstLengthUsed
		PokeInt	(streamHead, 40, 0)						'dwDstUser
		PokeInt	(streamHead, 44, 0)						'dwReservedDriver
		If acmStreamPrepareHeader( g_stream, LockBank(streamHead), 0 ) Return False

		Return True

	EndMethod


	Method StreamOpenDebug:Int()

		' open an ACM conversion stream -----------------------------------------------------------------
		WriteStdout("acmStreamOpen...")
		If acmError( acmStreamOpen( g_stream, Null, LockBank(informat), LockBank(outFormat), Null, 0, 0, 0) ) Return False

		' open file -------------------------------------------------------------------------------------
		'fpIn = OpenStream(File$)
		If Not fpIn Then RuntimeError("Unable to open MP3")

		' find out how big the decompressed buffer will be and allocate the buffers ---------------------
		Local rawbufsize:Int
		WriteStdout("acmStreamSize...")
		If acmError( acmStreamSize( g_stream, BLOCK_SIZE, rawbufsize, ACM_STREAMSIZEF_SOURCE ) ) Return False
		inbuf:TBank = CreateBank(BLOCK_SIZE)
		outbuf:TBank = CreateBank(rawbufsize)
	
		' prepare the decoder ---------------------------------------------------------------------------
		streamHead:TBank = CreateBank(100)
		PokeInt	(streamHead, 0,  100)					'cbStruct	
		PokeInt	(streamHead, 4,  0)						'fdwStatus	
		PokeInt	(streamHead, 8,  0)						'dwUser	
		PokeInt	(streamHead, 12, Int(BankBuf(inbuf)) )	'pbSrc	
		PokeInt	(streamHead, 16, BLOCK_SIZE)			'cbSrcLength
		PokeInt	(streamHead, 20, 0)						'cbSrcLengthUsed
		PokeInt	(streamHead, 24, 0)						'dwSrcUser
		PokeInt	(streamHead, 28, Int(BankBuf(outbuf)))	'pbDst
		PokeInt	(streamHead, 32, rawbufsize)			'cbDstLength
		PokeInt	(streamHead, 36, 0)						'cbDstLengthUsed
		PokeInt	(streamHead, 40, 0)						'dwDstUser
		PokeInt	(streamHead, 44, 0)						'dwReservedDriver
		WriteStdout("acmStreamPrepareHeader...")
		If acmError( acmStreamPrepareHeader( g_stream, LockBank(streamHead), 0 ) ) Return False

		Return True

	EndMethod


	Method Delete()
		CloseStream(fpIn)
		acmStreamUnprepareHeader( g_stream, BankBuf(streamHead), 0 )
		acmStreamClose( g_stream, 0 )
'		Print "acmStreamClose"
	EndMethod

'	Method Stop()
'		'Super.Stop
'		Stream.Seek(LoopSeek); Stream_Pos=0
'	EndMethod

	Method FillBuffer(SoundData:Int,Length:Int)
		
		Local count:Int
	
		Repeat

			If ChunkSize=<0
				If Eof(fpIn)
					SeekStream(fpIn,0)
					If STREAM_SIZE<>STREAM_POS/4 Then STREAM_SIZE=STREAM_POS/4
					STREAM_POS = 0
					If STREAM_LOOP = False Then PlayStatus = False
				EndIf
				count = ReadBank(inbuf,fpIn,0,BLOCK_SIZE )
				If count=<0 Then Return
				acmStreamConvert( g_stream, BankBuf(streamHead), ACM_STREAMCONVERTF_BLOCKALIGN )
				ChunkSize	= PeekInt(streamHead,36)
				ChunkPos	= BankBuf(outbuf)
			EndIf
	
			If Length=<ChunkSize
				MemCopy(Byte Ptr(SoundData),chunkpos,length)
				ChunkSize:-Length
				ChunkPos:+length
				STREAM_POS:+length
				SoundData:+Length
				Length=0
			Else 'Length>ChunkSize
				MemCopy(Byte Ptr(SoundData),ChunkPos,ChunkSize)
				Length:-ChunkSize
				SoundData:+ChunkSize
				STREAM_POS:+ChunkSize
				ChunkSize=0
				ChunkPos:+ChunkSize
			EndIf

		Until Length = 0

	EndMethod


	Method CalcSize()
'		Print "ACM CALCSIZE"
		If STREAM_SIZE Then Return
		If acmError( acmStreamSize( g_stream, StreamSize(fpIn), STREAM_SIZE, ACM_STREAMSIZEF_SOURCE) )
			STREAM_SIZE=0
		EndIf
		STREAM_SIZE:/4
	EndMethod

	Method Geti:Int(Param:Int)
		Select Param
			Case MM_LENGTH	 		; CalcSize ; Return STREAM_SIZE
		EndSelect
		Return Super.Geti(Param)
	EndMethod

EndType


' ----------------------------------------------------------

'Type WAVEFORMATEX
'  	Field wFormatTag		:Short 	' Waveform-audio format type. A complete list of format tags can be found in the Mmreg.h header file. For one- Or two-channel PCM data, this value should be WAVE_FORMAT_PCM. 
'  	Field nChannels			:Short 	' Number of channels in the waveform-audio data. Monaural data uses one channel And stereo data uses two channels. 
'  	Field nSamplesPerSec    	:Int   	' Sample rate, in samples per second (hertz). If wFormatTag is WAVE_FORMAT_PCM, Then common values For nSamplesPerSec are 8.0 kHz, 11.025 kHz, 22.05 kHz, And 44.1 kHz. For non-PCM formats, this member must be computed according To the manufacturer's specification of the format tag. 
'  	Field nAvgBytesPerSec   	:Int   	' Required average data-transfer rate, in bytes per second, For the format tag. If wFormatTag is WAVE_FORMAT_PCM, nAvgBytesPerSec should be equal To the product of nSamplesPerSec And nBlockAlign. For non-PCM formats, this member must be computed according To the manufacturer's specification of the format tag. 
'  	Field nBlockAlign			:Short 	' Block alignment, in bytes. The block alignment is the minimum atomic unit of data For the wFormatTag format type. If wFormatTag is WAVE_FORMAT_PCM Or WAVE_FORMAT_EXTENSIBLE, nBlockAlign must be equal To the product of nChannels And wBitsPerSample divided by 8 (bits per Byte). For non-PCM formats, this member must be computed according To the manufacturer's specification of the format tag.  :Software must process a multiple of nBlockAlign bytes of Data at a time. Data written To And Read from a device must always start at the beginning of a block. For example, it is illegal To start playback of PCM Data in the middle of a sample (that is, on a non-block-aligned boundary). 
'  	Field wBitsPerSample		:Short 	' Bits per sample For the wFormatTag format type. If wFormatTag is WAVE_FORMAT_PCM, Then wBitsPerSample should be equal To 8 Or 16. For non-PCM formats, this member must be set according To the manufacturer's specification of the format tag. If wFormatTag is WAVE_FORMAT_EXTENSIBLE, this value can be any integer multiple of 8. Some compression schemes cannot define a value for wBitsPerSample, so this member can be zero. 
'	Field cbSize			:Short 	' Size, in bytes, of extra format information appended To the End of the WAVEFORMATEX structure. This information can be used by non-PCM formats To store extra attributes For the wFormatTag. If no extra information is required by the wFormatTag, this member must be set To zero. For WAVE_FORMAT_PCM formats (And only WAVE_FORMAT_PCM formats), this member is ignored. 
'EndType 

'Type WAVEFILTER
'	Field cbStruct		:Int		= 32
'	Field dwFilterTag		:Int 
'	Field fdwFilter		:Int
'	Field dwReserved1	:Int		
'	Field dwReserved2	:Int
'	Field dwReserved3	:Int
'	Field dwReserved4	:Int
'	Field dwReserved5	:Int
'EndType 

' -----------------------------------------------------------

Function acmError:Int(Err:Int)
	Select Err
	Case MMSYSERR_NOERROR		; 'Print "acm - okay"
	Case MMSYSERR_ERROR        	; Print "acm - unspecified error"
	Case MMSYSERR_BADDEVICEID  	; Print "acm - device ID out of range"
	Case MMSYSERR_NOTENABLED   	; Print "acm - driver failed enable"
	Case MMSYSERR_ALLOCATED    	; Print "acm - device already allocated"
	Case MMSYSERR_INVALHANDLE  	; Print "acm - device handle is invalid"
	Case MMSYSERR_NODRIVER     	; Print "acm - no device driver present"
	Case MMSYSERR_NOMEM        	; Print "acm - memory allocation error"
	Case MMSYSERR_NOTSUPPORTED	; Print "acm - Function isn't supported"
	Case MMSYSERR_BADERRNUM    	; Print "acm - error value out of range"
	Case MMSYSERR_INVALFLAG    	; Print "acm - invalid flag passed"
	Case MMSYSERR_INVALPARAM   	; Print "acm - invalid parameter passed"
	Case MMSYSERR_HANDLEBUSY   	; Print "acm - handle being used"
	Case MMSYSERR_INVALIDALIAS 	; Print "acm - specified alias Not found"
	Case MMSYSERR_BADDB        	; Print "acm - bad registry database"
	Case MMSYSERR_KEYNOTFOUND  	; Print "acm - registry key Not found"
	Case MMSYSERR_READERROR    	; Print "acm - registry read error"
	Case MMSYSERR_WRITEERROR   	; Print "acm - registry write error"
	Case MMSYSERR_DELETEERROR  	; Print "acm - registry delete error"
	Case MMSYSERR_VALNOTFOUND  	; Print "acm - registry value Not found"
	Case MMSYSERR_NODRIVERCB   	; Print "acm - driver does Not call DriverCallback"
	Case MMSYSERR_LASTERROR    	; Print "acm - last error in range"
	Case ACMERR_NOTPOSSIBLE 	; Print "acm - not possible"
	Case ACMERR_BUSY        	; Print "acm - busy"
	Case ACMERR_UNPREPARED  	; Print "acm - unprepared"
	Case ACMERR_CANCELED    	; Print "acm - canceled"
	Default 					; Print "acm - unknown error code ~q"+Err+"~q"
	EndSelect
	Return Err
EndFunction

' -----------------------------------------------------------
Rem
Extern 
'"win32"

	Function acmDriverAdd				:Int 		(phadid:Int Ptr, hinstModule, lParam, dwPriority, fdwAdd)
*	Function acmDriverClose			:Int 		(had, fdwClose)
*	Function acmDriverDetails			:Int 		(hadid:Int, padd:TacmDriverDetails, fdwDetails:Int)
	Function acmDriverEnum			:Int 		(fnCallback:Byte Ptr, dwInstance:Int, fdwEnum:Int)
'	Function acmDriverEnumCallback		:Int 		(hadid:Int, dwInstance:Int, fdwSupport:Int) 
	Function acmDriverID				:Int 		(hao, phadid:Int Ptr, fdwDriverID:Int)
	Function acmDriverMessage			:Int 		(had, uMsg:Int, lParam1:Int, lParam2:Int)
*	Function acmDriverOpen			:Int 		(phad:Int Ptr, hadid:Int, fdwOpen:Int)
	Function acmDriverPriority			:Int 		(hadid:Int, dwPriority:Int, fdwPriority:Int)
	Function acmDriverProc			:Byte Ptr	(dwID:Int, hdrvr:Int, uMsg:Int, lParam1:Int, lParam2:Int)
	Function acmDriverRemove			:Int		(hadid:Int, fdwRemove:Int)

	Function acmFilterChoose			:Int		(pafltrc:Int Ptr)
	Function acmFilterChooseHookProc	:Byte Ptr 	(hwnd:Int, uMsg:Int, wParam:Short, lParam:Int)
	Function acmFilterDetails			:Int		(had:Int, pafd:Int Ptr, fdwDetails:Int)
	Function acmFilterEnum			:Int		(had:Int, pafd:Int Ptr, fnCallback:Byte Ptr, dwInstance:Int Ptr, fdwEnum:Int)
'	Function acmFilterEnumCallback		:Int Ptr	(hadid:Int, pafd:Int Ptr, dwInstance:Int Ptr, fdwSupport:Int)
	Function acmFilterTagDetails			:Int		(had:Int, paftd:Int Ptr, fdwDetails:Int Ptr)
	Function acmFilterTagEnum			:Int		(had:Int, paftd:Int Ptr, fnCallback:Byte Ptr, dwInstance:Int Ptr, fdwEnum:Int)
	Function acmFilterTagEnumCallback	:Byte Ptr	(hadid:Int, paftd:Int Ptr, dwInstance:Int Ptr, fdwSupport:Int)

	Function acmFormatChoose			:Int		(pfmtc:Int Ptr)
	Function acmFormatChooseHookProc	:Byte Ptr	(hwnd:Int, uMsg:Int, wParam:Short Ptr, lParam:Int Ptr)
	Function acmFormatDetails			:Int		(had:Int, pafd:Int Ptr, fdwDetails:Int)
	Function acmFormatEnum			:Int		(had:Int, pafd:Int Ptr, fnCallback:Byte Ptr, dwInstance:Int Ptr, fdwEnum:Int)
'	Function acmFormatEnumCallback		:Int		(hadid:Int, pafd:Int Ptr, dwInstance:Int Ptr, fdwSupport:Int)
*	Function acmFormatSuggest			:Int 		(had:Int, pwfxSrc:WAVEFORMATEX, pwfxDst:WAVEFORMATEX, cbwfxDst:Int, fdwSuggest:Int)
*	Function acmFormatTagDetails		:Int		(had:Int, paftd:Int Ptr, fdwDetails:Int)
	Function acmFormatTagEnum		:Int		(had:Int, paftd:Int Ptr, fnCallback:Byte Ptr, dwInstance:Int Ptr, fdwEnum:Int)
'	Function acmFormatTagEnumCallback	:Byte Ptr	(hadid:Int, paftd:Int Ptr, dwInstance:Int Ptr, fdwSupport:Int)

	Function acmGetVersion			:Int 		()
	Function acmMetrics				:Int		(hao:Int, uMetric:Int, pMetric:Int Ptr)
	
*	Function acmStreamClose			:Int		(has:Int, fdwClose:Int)
*	Function acmStreamConvert			:Int		(has:Int, pash:Int Ptr, fdwConvert:Int)
'	Function acmStreamConvertCallback	:Byte Ptr	(has:Int, uMsg:Int, dwInstance:Int, lParam1:Int, lParam2:Int)
	Function acmStreamMessage		:Int		(has:Int, uMsg:Int, lParam1:Int, lParam2:Int)
	Function acmStreamOpen			:Int		(phas:Int Var, had:Int, pwfxSrc:WAVEFORMATEX, pwfxDst:WAVEFORMATEX, pwfltr:Int, dwCallback:Int, dwInstance:Int, fdwOpen:Int)
*	Function acmStreamPrepareHeader	:Int		(has:Int, pash:Int Ptr, fdwPrepare:Int)
	Function acmStreamReset			:Int		(has:Int, fdwReset:Int)
*	Function acmStreamSize			:Int		(has:Int, cbInput:Int, pdwOutputBytes:Int, fdwSize:Int)
*	Function acmStreamUnprepareHeader	:Int		(has:Int, pash:Int Ptr, fdwUnprepare:Int)

EndExtern
EndRem
'/***********************************************************************
' * Defines/Enums
' */

' ----------------------------------------------------------- mmsystem.h

Const MMSYSERR_BASE					:Int = 0
Const MMSYSERR_NOERROR      		:Int = 0                   			'/* no error */
Const MMSYSERR_ERROR        		:Int = (MMSYSERR_BASE + 1)  	'/* unspecified error */
Const MMSYSERR_BADDEVICEID  		:Int = (MMSYSERR_BASE + 2)  	'/* device ID out of range */
Const MMSYSERR_NOTENABLED   		:Int = (MMSYSERR_BASE + 3)  	'/* driver failed enable */
Const MMSYSERR_ALLOCATED    		:Int = (MMSYSERR_BASE + 4)  	'/* device already allocated */
Const MMSYSERR_INVALHANDLE  		:Int = (MMSYSERR_BASE + 5)  	'/* device handle is invalid */
Const MMSYSERR_NODRIVER     		:Int = (MMSYSERR_BASE + 6)  	'/* no device driver present */
Const MMSYSERR_NOMEM        		:Int = (MMSYSERR_BASE + 7)  	'/* memory allocation error */
Const MMSYSERR_NOTSUPPORTED 		:Int = (MMSYSERR_BASE + 8)  	'/* Function isn't supported */
Const MMSYSERR_BADERRNUM    		:Int = (MMSYSERR_BASE + 9)  	'/* error value out of range */
Const MMSYSERR_INVALFLAG    		:Int = (MMSYSERR_BASE + 10) 	'/* invalid flag passed */
Const MMSYSERR_INVALPARAM   		:Int = (MMSYSERR_BASE + 11) 	'/* invalid parameter passed */
Const MMSYSERR_HANDLEBUSY   		:Int = (MMSYSERR_BASE + 12) 	'/* handle being used */
Const MMSYSERR_INVALIDALIAS 		:Int = (MMSYSERR_BASE + 13) 	'/* specified alias Not found */
Const MMSYSERR_BADDB        		:Int = (MMSYSERR_BASE + 14) 	'/* bad registry database */
Const MMSYSERR_KEYNOTFOUND  		:Int = (MMSYSERR_BASE + 15) 	'/* registry key Not found */
Const MMSYSERR_READERROR    		:Int = (MMSYSERR_BASE + 16) 	'/* registry read error */
Const MMSYSERR_WRITEERROR   		:Int = (MMSYSERR_BASE + 17) 	'/* registry write error */
Const MMSYSERR_DELETEERROR  		:Int = (MMSYSERR_BASE + 18) 	'/* registry Delete error */
Const MMSYSERR_VALNOTFOUND  		:Int = (MMSYSERR_BASE + 19) 	'/* registry value Not found */
Const MMSYSERR_NODRIVERCB   		:Int = (MMSYSERR_BASE + 20) 	'/* driver does Not call DriverCallback */
Const MMSYSERR_LASTERROR    		:Int = (MMSYSERR_BASE + 20) 	'/* last error in range */

' ----------------------------------------------------------- mmreg.h
' WAVE form wFormatTag IDs */

Const  WAVE_FORMAT_UNKNOWN                    		:Int = $0000 '/* Microsoft Corporation */
Const  WAVE_FORMAT_PCM 								:Int = $0001
Const  WAVE_FORMAT_ADPCM                      		:Int = $0002 '/* Microsoft Corporation */
Const  WAVE_FORMAT_IEEE_FLOAT                 		:Int = $0003 '/* Microsoft Corporation */
Const  WAVE_FORMAT_VSELP                      		:Int = $0004 '/* Compaq Computer Corp. */
Const  WAVE_FORMAT_IBM_CVSD                   		:Int = $0005 '/* IBM Corporation */
Const  WAVE_FORMAT_ALAW                       		:Int = $0006 '/* Microsoft Corporation */
Const  WAVE_FORMAT_MULAW                      		:Int = $0007 '/* Microsoft Corporation */
Const  WAVE_FORMAT_DTS                        		:Int = $0008 '/* Microsoft Corporation */
Const  WAVE_FORMAT_OKI_ADPCM                  		:Int = $0010 '/* OKI */
Const  WAVE_FORMAT_DVI_ADPCM                  		:Int = $0011 '/* Intel Corporation */
Const  WAVE_FORMAT_IMA_ADPCM                  		:Int = (WAVE_FORMAT_DVI_ADPCM) '/*  Intel Corporation */
Const  WAVE_FORMAT_MEDIASPACE_ADPCM           		:Int = $0012 '/* Videologic */
Const  WAVE_FORMAT_SIERRA_ADPCM               		:Int = $0013 '/* Sierra Semiconductor Corp */
Const  WAVE_FORMAT_G723_ADPCM                 		:Int = $0014 '/* Antex Electronics Corporation */
Const  WAVE_FORMAT_DIGISTD                    		:Int = $0015 '/* DSP Solutions, Inc. */
Const  WAVE_FORMAT_DIGIFIX                    		:Int = $0016 '/* DSP Solutions, Inc. */
Const  WAVE_FORMAT_DIALOGIC_OKI_ADPCM         		:Int = $0017 '/* Dialogic Corporation */
Const  WAVE_FORMAT_MEDIAVISION_ADPCM          		:Int = $0018 '/* Media Vision, Inc. */
Const  WAVE_FORMAT_CU_CODEC                   		:Int = $0019 '/* Hewlett-Packard Company */
Const  WAVE_FORMAT_YAMAHA_ADPCM               		:Int = $0020 '/* Yamaha Corporation of America */
Const  WAVE_FORMAT_SONARC                     		:Int = $0021 '/* Speech Compression */
Const  WAVE_FORMAT_DSPGROUP_TRUESPEECH				:Int = $0022 '/* DSP Group, Inc */
Const  WAVE_FORMAT_ECHOSC1                    		:Int = $0023 '/* Echo Speech Corporation */
Const  WAVE_FORMAT_AUDIOFILE_AF36             		:Int = $0024 '/* Virtual Music, Inc. */
Const  WAVE_FORMAT_APTX                       		:Int = $0025 '/* Audio Processing Technology */
Const  WAVE_FORMAT_AUDIOFILE_AF10             		:Int = $0026 '/* Virtual Music, Inc. */
Const  WAVE_FORMAT_PROSODY_1612               		:Int = $0027 '/* Aculab plc */
Const  WAVE_FORMAT_LRC                        		:Int = $0028 '/* Merging Technologies S.A. */
Const  WAVE_FORMAT_DOLBY_AC2                  		:Int = $0030 '/* Dolby Laboratories */
Const  WAVE_FORMAT_GSM610                     		:Int = $0031 '/* Microsoft Corporation */
Const  WAVE_FORMAT_MSNAUDIO                   		:Int = $0032 '/* Microsoft Corporation */
Const  WAVE_FORMAT_ANTEX_ADPCME               		:Int = $0033 '/* Antex Electronics Corporation */
Const  WAVE_FORMAT_CONTROL_RES_VQLPC          		:Int = $0034 '/* Control Resources Limited */
Const  WAVE_FORMAT_DIGIREAL                   		:Int = $0035 '/* DSP Solutions, Inc. */
Const  WAVE_FORMAT_DIGIADPCM                  		:Int = $0036 '/* DSP Solutions, Inc. */
Const  WAVE_FORMAT_CONTROL_RES_CR10           		:Int = $0037 '/* Control Resources Limited */
Const  WAVE_FORMAT_NMS_VBXADPCM               		:Int = $0038 '/* Natural MicroSystems */
Const  WAVE_FORMAT_CS_IMAADPCM                		:Int = $0039 '/* Crystal Semiconductor IMA ADPCM */
Const  WAVE_FORMAT_ECHOSC3                    		:Int = $003A '/* Echo Speech Corporation */
Const  WAVE_FORMAT_ROCKWELL_ADPCM             		:Int = $003B '/* Rockwell International */
Const  WAVE_FORMAT_ROCKWELL_DIGITALK          		:Int = $003C '/* Rockwell International */
Const  WAVE_FORMAT_XEBEC                      		:Int = $003D '/* Xebec Multimedia Solutions Limited */
Const  WAVE_FORMAT_G721_ADPCM                 		:Int = $0040 '/* Antex Electronics Corporation */
Const  WAVE_FORMAT_G728_CELP                  		:Int = $0041 '/* Antex Electronics Corporation */
Const  WAVE_FORMAT_MSG723                     		:Int = $0042 '/* Microsoft Corporation */
Const  WAVE_FORMAT_MPEG                       		:Int = $0050 '/* Microsoft Corporation */
Const  WAVE_FORMAT_RT24                       		:Int = $0052 '/* InSoft, Inc. */
Const  WAVE_FORMAT_PAC                        		:Int = $0053 '/* InSoft, Inc. */
Const  WAVE_FORMAT_MPEGLAYER3                 		:Int = $0055 '/* ISO/MPEG Layer3 Format Tag */
Const  WAVE_FORMAT_LUCENT_G723                		:Int = $0059 '/* Lucent Technologies */
Const  WAVE_FORMAT_CIRRUS                     		:Int = $0060 '/* Cirrus Logic */
Const  WAVE_FORMAT_ESPCM                      		:Int = $0061 '/* ESS Technology */
Const  WAVE_FORMAT_VOXWARE                    		:Int = $0062 '/* Voxware Inc */
Const  WAVE_FORMAT_CANOPUS_ATRAC              		:Int = $0063 '/* Canopus, co., Ltd. */
Const  WAVE_FORMAT_G726_ADPCM                 		:Int = $0064 '/* APICOM */
Const  WAVE_FORMAT_G722_ADPCM                 		:Int = $0065 '/* APICOM */
Const  WAVE_FORMAT_DSAT_DISPLAY               		:Int = $0067 '/* Microsoft Corporation */
Const  WAVE_FORMAT_VOXWARE_BYTE_ALIGNED       		:Int = $0069 '/* Voxware Inc */
Const  WAVE_FORMAT_VOXWARE_AC8                		:Int = $0070 '/* Voxware Inc */
Const  WAVE_FORMAT_VOXWARE_AC10               		:Int = $0071 '/* Voxware Inc */
Const  WAVE_FORMAT_VOXWARE_AC16               		:Int = $0072 '/* Voxware Inc */
Const  WAVE_FORMAT_VOXWARE_AC20               		:Int = $0073 '/* Voxware Inc */
Const  WAVE_FORMAT_VOXWARE_RT24               		:Int = $0074 '/* Voxware Inc */
Const  WAVE_FORMAT_VOXWARE_RT29               		:Int = $0075 '/* Voxware Inc */
Const  WAVE_FORMAT_VOXWARE_RT29HW             		:Int = $0076 '/* Voxware Inc */
Const  WAVE_FORMAT_VOXWARE_VR12               		:Int = $0077 '/* Voxware Inc */
Const  WAVE_FORMAT_VOXWARE_VR18               		:Int = $0078 '/* Voxware Inc */
Const  WAVE_FORMAT_VOXWARE_TQ40               		:Int = $0079 '/* Voxware Inc */
Const  WAVE_FORMAT_SOFTSOUND                  		:Int = $0080 '/* Softsound, Ltd. */
Const  WAVE_FORMAT_VOXWARE_TQ60               		:Int = $0081 '/* Voxware Inc */
Const  WAVE_FORMAT_MSRT24                     		:Int = $0082 '/* Microsoft Corporation */
Const  WAVE_FORMAT_G729A                      		:Int = $0083 '/* AT&T Labs, Inc. */
Const  WAVE_FORMAT_MVI_MVI2                   		:Int = $0084 '/* Motion Pixels */
Const  WAVE_FORMAT_DF_G726                    		:Int = $0085 '/* DataFusion Systems (Pty) (Ltd) */
Const  WAVE_FORMAT_DF_GSM610                  		:Int = $0086 '/* DataFusion Systems (Pty) (Ltd) */
Const  WAVE_FORMAT_ISIAUDIO                   		:Int = $0088 '/* Iterated Systems, Inc. */
Const  WAVE_FORMAT_ONLIVE                     		:Int = $0089 '/* OnLive! Technologies, Inc. */
Const  WAVE_FORMAT_SBC24                      		:Int = $0091 '/* Siemens Business Communications Sys */
Const  WAVE_FORMAT_DOLBY_AC3_SPDIF            		:Int = $0092 '/* Sonic Foundry */
Const  WAVE_FORMAT_MEDIASONIC_G723            		:Int = $0093 '/* MediaSonic */
Const  WAVE_FORMAT_PROSODY_8KBPS              		:Int = $0094 '/* Aculab plc */
Const  WAVE_FORMAT_ZYXEL_ADPCM                		:Int = $0097 '/* ZyXEL Communications, Inc. */
Const  WAVE_FORMAT_PHILIPS_LPCBB              		:Int = $0098 '/* Philips Speech Processing */
Const  WAVE_FORMAT_PACKED                     		:Int = $0099 '/* Studer Professional Audio AG */
Const  WAVE_FORMAT_MALDEN_PHONYTALK           		:Int = $00A0 '/* Malden Electronics Ltd. */
Const  WAVE_FORMAT_RHETOREX_ADPCM             		:Int = $0100 '/* Rhetorex Inc. */
Const  WAVE_FORMAT_IRAT                       		:Int = $0101 '/* BeCubed Software Inc. */
Const  WAVE_FORMAT_VIVO_G723                  		:Int = $0111 '/* Vivo Software */
Const  WAVE_FORMAT_VIVO_SIREN                 		:Int = $0112 '/* Vivo Software */
Const  WAVE_FORMAT_DIGITAL_G723               		:Int = $0123 '/* Digital Equipment Corporation */
Const  WAVE_FORMAT_SANYO_LD_ADPCM             		:Int = $0125 '/* Sanyo Electric Co., Ltd. */
Const  WAVE_FORMAT_SIPROLAB_ACEPLNET          		:Int = $0130 '/* Sipro Lab Telecom Inc. */
Const  WAVE_FORMAT_SIPROLAB_ACELP4800         		:Int = $0131 '/* Sipro Lab Telecom Inc. */
Const  WAVE_FORMAT_SIPROLAB_ACELP8V3          		:Int = $0132 '/* Sipro Lab Telecom Inc. */
Const  WAVE_FORMAT_SIPROLAB_G729              		:Int = $0133 '/* Sipro Lab Telecom Inc. */
Const  WAVE_FORMAT_SIPROLAB_G729A             		:Int = $0134 '/* Sipro Lab Telecom Inc. */
Const  WAVE_FORMAT_SIPROLAB_KELVIN            		:Int = $0135 '/* Sipro Lab Telecom Inc. */
Const  WAVE_FORMAT_G726ADPCM                  		:Int = $0140 '/* Dictaphone Corporation */
Const  WAVE_FORMAT_QUALCOMM_PUREVOICE         		:Int = $0150 '/* Qualcomm, Inc. */
Const  WAVE_FORMAT_QUALCOMM_HALFRATE          		:Int = $0151 '/* Qualcomm, Inc. */
Const  WAVE_FORMAT_TUBGSM                     		:Int = $0155 '/* Ring Zero Systems, Inc. */
Const  WAVE_FORMAT_MSAUDIO1                   		:Int = $0160 '/* Microsoft Corporation */
Const  WAVE_FORMAT_WMAUDIO2  						:Int = $0161
Const  WAVE_FORMAT_CREATIVE_ADPCM             		:Int = $0200 '/* Creative Labs, Inc */
Const  WAVE_FORMAT_CREATIVE_FASTSPEECH8       		:Int = $0202 '/* Creative Labs, Inc */
Const  WAVE_FORMAT_CREATIVE_FASTSPEECH10      		:Int = $0203 '/* Creative Labs, Inc */
Const  WAVE_FORMAT_UHER_ADPCM                 		:Int = $0210 '/* UHER informatic GmbH */
Const  WAVE_FORMAT_QUARTERDECK                		:Int = $0220 '/* Quarterdeck Corporation */
Const  WAVE_FORMAT_ILINK_VC                   		:Int = $0230 '/* I-link Worldwide */
Const  WAVE_FORMAT_RAW_SPORT                  		:Int = $0240 '/* Aureal Semiconductor */
Const  WAVE_FORMAT_IPI_HSX                    		:Int = $0250 '/* Interactive Products, Inc. */
Const  WAVE_FORMAT_IPI_RPELP                  		:Int = $0251 '/* Interactive Products, Inc. */
Const  WAVE_FORMAT_CS2                        		:Int = $0260 '/* Consistent Software */
Const  WAVE_FORMAT_SONY_SCX                   		:Int = $0270 '/* Sony Corp. */
Const  WAVE_FORMAT_FM_TOWNS_SND               		:Int = $0300 '/* Fujitsu Corp. */
Const  WAVE_FORMAT_BTV_DIGITAL                		:Int = $0400 '/* Brooktree Corporation */
Const  WAVE_FORMAT_QDESIGN_MUSIC              		:Int = $0450 '/* QDesign Corporation */
Const  WAVE_FORMAT_VME_VMPCM                  		:Int = $0680 '/* AT&T Labs, Inc. */
Const  WAVE_FORMAT_TPC                        		:Int = $0681 '/* AT&T Labs, Inc. */
Const  WAVE_FORMAT_OLIGSM                     		:Int = $1000 '/* Ing C. Olivetti & C., S.p.A. */
Const  WAVE_FORMAT_OLIADPCM                   		:Int = $1001 '/* Ing C. Olivetti & C., S.p.A. */
Const  WAVE_FORMAT_OLICELP                    		:Int = $1002 '/* Ing C. Olivetti & C., S.p.A. */
Const  WAVE_FORMAT_OLISBC                     		:Int = $1003 '/* Ing C. Olivetti & C., S.p.A. */
Const  WAVE_FORMAT_OLIOPR                     		:Int = $1004 '/* Ing C. Olivetti & C., S.p.A. */
Const  WAVE_FORMAT_LH_CODEC                   		:Int = $1100 '/* Lernout & Hauspie */
Const  WAVE_FORMAT_NORRIS                     		:Int = $1400 '/* Norris Communications, Inc. */
Const  WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS    		:Int = $1500 '/* AT&T Labs, Inc. */
Const  WAVE_FORMAT_DVM                        		:Int = $2000 '/* FAST Multimedia AG */

Const WAVE_FORMAT_WMA_SPDIF          				:Int = $0164
'Const WAVE_FORMAT_DOLBY_AC3_SPDIF    				:Int = $0092

Const MPEGLAYER3_WFX_EXTRA_BYTES					:Int = 12
Const MPEGLAYER3_ID_UNKNOWN							:Int = 0
Const MPEGLAYER3_ID_MPEG							:Int = 1
Const MPEGLAYER3_ID_CONSTANTFRAMESIZE				:Int = 2

Const MPEGLAYER3_FLAG_PADDING_ISO					:Int = $00000000
Const MPEGLAYER3_FLAG_PADDING_ON					:Int = $00000001
Const MPEGLAYER3_FLAG_PADDING_OFF					:Int = $00000002

' -----------------------------------------------------------

Const  ACMERR_BASE									:Int = 512
Const  ACMERR_NOTPOSSIBLE 							:Int = (ACMERR_BASE + 0)
Const  ACMERR_BUSY        							:Int = (ACMERR_BASE + 1)
Const  ACMERR_UNPREPARED  							:Int = (ACMERR_BASE + 2)
Const  ACMERR_CANCELED    							:Int = (ACMERR_BASE + 3)

'Const  MM_ACM_OPEN  							= MM_STREAM_OPEN
'Const  MM_ACM_CLOSE 							= MM_STREAM_CLOSE
'Const  MM_ACM_DONE  							= MM_STREAM_DONE

Const  ACM_DRIVERADDF_FUNCTION						:Int = $00000003
Const  ACM_DRIVERADDF_NOTIFYHWND 					:Int = $00000004
Const  ACM_DRIVERADDF_TYPEMASK   					:Int = $00000007
Const  ACM_DRIVERADDF_LOCAL      					:Int = $00000000
Const  ACM_DRIVERADDF_GLOBAL     					:Int = $00000008

Const  ACMDRIVERDETAILS_SHORTNAME_CHARS				:Int = 32
Const  ACMDRIVERDETAILS_LONGNAME_CHARS				:Int = 128
Const  ACMDRIVERDETAILS_COPYRIGHT_CHARS				:Int = 80
Const  ACMDRIVERDETAILS_LICENSING_CHARS				:Int = 128
Const  ACMDRIVERDETAILS_FEATURES_CHARS				:Int = 512

'Const  ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC mmioFOURCC('a', 'u', 'd', 'c')
'Const  ACMDRIVERDETAILS_FCCCOMP_UNDEFINED  mmioFOURCC('\0', '\0', '\0', '\0')

Const  ACMDRIVERDETAILS_SUPPORTF_CODEC				:Int = $00000001
Const  ACMDRIVERDETAILS_SUPPORTF_CONVERTER			:Int = $00000002
Const  ACMDRIVERDETAILS_SUPPORTF_FILTER    			:Int = $00000004
Const  ACMDRIVERDETAILS_SUPPORTF_HARDWARE  			:Int = $00000008
Const  ACMDRIVERDETAILS_SUPPORTF_ASYNC     			:Int = $00000010
Const  ACMDRIVERDETAILS_SUPPORTF_LOCAL     			:Int = $40000000
Const  ACMDRIVERDETAILS_SUPPORTF_DISABLED  			:Int = $80000000

Const  ACM_DRIVERENUMF_NOLOCAL						:Int = $40000000
Const  ACM_DRIVERENUMF_DISABLED						:Int = $80000000

Const  ACM_DRIVERPRIORITYF_ENABLE    				:Int = $00000001
Const  ACM_DRIVERPRIORITYF_DISABLE   				:Int = $00000002
Const  ACM_DRIVERPRIORITYF_ABLEMASK  				:Int = $00000003
Const  ACM_DRIVERPRIORITYF_BEGIN     				:Int = $00010000
Const  ACM_DRIVERPRIORITYF_END       				:Int = $00020000
Const  ACM_DRIVERPRIORITYF_DEFERMASK 				:Int = $00030000

Const  MM_ACM_FILTERCHOOSE 							:Int = 8000

Const  FILTERCHOOSE_MESSAGE							:Int = 0
Const  FILTERCHOOSE_FILTERTAG_VERIFY 				:Int = (FILTERCHOOSE_MESSAGE+0)
Const  FILTERCHOOSE_FILTER_VERIFY    				:Int = (FILTERCHOOSE_MESSAGE+1)
Const  FILTERCHOOSE_CUSTOM_VERIFY    				:Int = (FILTERCHOOSE_MESSAGE+2)

Const  ACMFILTERCHOOSE_STYLEF_SHOWHELP             	:Int = $00000004
Const  ACMFILTERCHOOSE_STYLEF_ENABLEHOOK           	:Int = $00000008
Const  ACMFILTERCHOOSE_STYLEF_ENABLETEMPLATE       	:Int = $00000010
Const  ACMFILTERCHOOSE_STYLEF_ENABLETEMPLATEHANDLE	:Int = $00000020
Const  ACMFILTERCHOOSE_STYLEF_INITTOFILTERSTRUCT  	:Int = $00000040
Const  ACMFILTERCHOOSE_STYLEF_CONTEXTHELP          	:Int = $00000080

Const  ACMFILTERDETAILS_FILTER_CHARS				:Int = 128

Const  ACM_FILTERDETAILSF_INDEX     				:Int = $00000000
Const  ACM_FILTERDETAILSF_FILTER    				:Int = $00000001
Const  ACM_FILTERDETAILSF_QUERYMASK 				:Int = $0000000F

Const  ACMFILTERTAGDETAILS_FILTERTAG_CHARS 			:Int = 48

Const  ACM_FILTERTAGDETAILSF_INDEX       			:Int = $00000000
Const  ACM_FILTERTAGDETAILSF_FILTERTAG   			:Int = $00000001
Const  ACM_FILTERTAGDETAILSF_LARGESTSIZE 			:Int = $00000002
Const  ACM_FILTERTAGDETAILSF_QUERYMASK   			:Int = $0000000F

Const  ACM_FILTERENUMF_DWFILTERTAG 					:Int = $00010000

'Const  ACMHELPMSGSTRINGA       "acmchoose_help"
'Const  ACMHELPMSGSTRINGW       L"acmchoose_help"
'Const  ACMHELPMSGSTRING16       "acmchoose_help"
'
'Const  ACMHELPMSGCONTEXTMENUA  "acmchoose_contextmenu"
'Const  ACMHELPMSGCONTEXTMENUW  L"acmchoose_contextmenu"
'Const  ACMHELPMSGCONTEXTMENU16   "acmchoose_contextmenu"
'
'Const  ACMHELPMSGCONTEXTHELPA  "acmchoose_contexthelp"
'Const  ACMHELPMSGCONTEXTHELPW  L"acmchoose_contexthelp"
'Const  ACMHELPMSGCONTEXTHELP16   "acmchoose_contexthelp"

Const  MM_ACM_FORMATCHOOSE 							:Int = $8000

Const  FORMATCHOOSE_MESSAGE							:Int = 0
Const  FORMATCHOOSE_FORMATTAG_VERIFY 				:Int = (FORMATCHOOSE_MESSAGE+0)
Const  FORMATCHOOSE_FORMAT_VERIFY    				:Int = (FORMATCHOOSE_MESSAGE+1)
Const  FORMATCHOOSE_CUSTOM_VERIFY    				:Int = (FORMATCHOOSE_MESSAGE+2)

Const  ACMFORMATCHOOSE_STYLEF_SHOWHELP             	:Int = $00000004
Const  ACMFORMATCHOOSE_STYLEF_ENABLEHOOK           	:Int = $00000008
Const  ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATE       	:Int = $00000010
Const  ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATEHANDLE 	:Int = $00000020
Const  ACMFORMATCHOOSE_STYLEF_INITTOWFXSTRUCT      	:Int = $00000040
Const  ACMFORMATCHOOSE_STYLEF_CONTEXTHELP          	:Int = $00000080

Const  ACMFORMATDETAILS_FORMAT_CHARS				:Int = 128

Const  ACM_FORMATDETAILSF_INDEX     				:Int = $00000000
Const  ACM_FORMATDETAILSF_FORMAT    				:Int = $00000001
Const  ACM_FORMATDETAILSF_QUERYMASK 				:Int = $0000000F

Const  ACM_FORMATENUMF_WFORMATTAG					:Int = $00010000
Const  ACM_FORMATENUMF_NCHANNELS      				:Int = $00020000
Const  ACM_FORMATENUMF_NSAMPLESPERSEC 				:Int = $00040000
Const  ACM_FORMATENUMF_WBITSPERSAMPLE 				:Int = $00080000
Const  ACM_FORMATENUMF_CONVERT        				:Int = $00100000
Const  ACM_FORMATENUMF_SUGGEST        				:Int = $00200000
Const  ACM_FORMATENUMF_HARDWARE       				:Int = $00400000
Const  ACM_FORMATENUMF_INPUT          				:Int = $00800000
Const  ACM_FORMATENUMF_OUTPUT         				:Int = $01000000

Const  ACM_FORMATSUGGESTF_WFORMATTAG     			:Int = $00010000
Const  ACM_FORMATSUGGESTF_NCHANNELS      			:Int = $00020000
Const  ACM_FORMATSUGGESTF_NSAMPLESPERSEC 			:Int = $00040000
Const  ACM_FORMATSUGGESTF_WBITSPERSAMPLE 			:Int = $00080000
Const  ACM_FORMATSUGGESTF_TYPEMASK       			:Int = $00FF0000

Const  ACMFORMATTAGDETAILS_FORMATTAG_CHARS			:Int = 48

Const  ACM_FORMATTAGDETAILSF_INDEX       			:Int = $00000000
Const  ACM_FORMATTAGDETAILSF_FORMATTAG   			:Int = $00000001
Const  ACM_FORMATTAGDETAILSF_LARGESTSIZE 			:Int = $00000002
Const  ACM_FORMATTAGDETAILSF_QUERYMASK   			:Int = $0000000F

Const  ACM_METRIC_COUNT_DRIVERS            			:Int = 1
Const  ACM_METRIC_COUNT_CODECS             			:Int = 2
Const  ACM_METRIC_COUNT_CONVERTERS         			:Int = 3
Const  ACM_METRIC_COUNT_FILTERS            			:Int = 4
Const  ACM_METRIC_COUNT_DISABLED           			:Int = 5
Const  ACM_METRIC_COUNT_HARDWARE           			:Int = 6
Const  ACM_METRIC_COUNT_LOCAL_DRIVERS     			:Int = 20
Const  ACM_METRIC_COUNT_LOCAL_CODECS      			:Int = 21
Const  ACM_METRIC_COUNT_LOCAL_CONVERTERS  			:Int = 22
Const  ACM_METRIC_COUNT_LOCAL_FILTERS     			:Int = 23
Const  ACM_METRIC_COUNT_LOCAL_DISABLED    			:Int = 24
Const  ACM_METRIC_HARDWARE_WAVE_INPUT     			:Int = 30
Const  ACM_METRIC_HARDWARE_WAVE_OUTPUT    			:Int = 31
Const  ACM_METRIC_MAX_SIZE_FORMAT         			:Int = 50
Const  ACM_METRIC_MAX_SIZE_FILTER         			:Int = 51
Const  ACM_METRIC_DRIVER_SUPPORT         			:Int = 100
Const  ACM_METRIC_DRIVER_PRIORITY        			:Int = 101

Const  ACM_STREAMCONVERTF_BLOCKALIGN 				:Int = $00000004
Const  ACM_STREAMCONVERTF_START      				:Int = $00000010
Const  ACM_STREAMCONVERTF_END        				:Int = $00000020

Const  ACMSTREAMHEADER_STATUSF_DONE     			:Int = $00010000
Const  ACMSTREAMHEADER_STATUSF_PREPARED 			:Int = $00020000
Const  ACMSTREAMHEADER_STATUSF_INQUEUE  			:Int = $00100000

Const  ACM_STREAMOPENF_QUERY       					:Int = $00000001
Const  ACM_STREAMOPENF_ASYNC       					:Int = $00000002
Const  ACM_STREAMOPENF_NONREALTIME 					:Int = $00000004

Const  ACM_STREAMSIZEF_SOURCE      					:Int = $00000000
Const  ACM_STREAMSIZEF_DESTINATION 					:Int = $00000001
Const  ACM_STREAMSIZEF_QUERYMASK   					:Int = $0000000F

'Const  ACMDM_USER                  						= (DRV_USER + $0000)
'Const  ACMDM_RESERVED_LOW          					= (DRV_USER + $2000)
'Const  ACMDM_RESERVED_HIGH         					= (DRV_USER + $2FFF)

'Const  ACMDM_BASE                  						= ACMDM_RESERVED_LOW

'Const  ACMDM_DRIVER_ABOUT          					= (ACMDM_BASE + 11)





'/***********************************************************************
' * Structures
' */

'Type TacmDriverDetails
'	Field cbStruct		:Int		'SizeOf(TacmDriverDetails)
'	Field fccType		:Int		'= ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC
'	Field fccComp		:Int		'= ACMDRIVERDETAILS_FCCCOMP_UNDEFINED
'	Field wMid			:Short 
'	Field wPid			:Short 
'	Field vdwACM		:Int 
'	Field vdwDriver		:Int
'	Field fdwSupport		:Int
'	Field cFormatTags	:Int
'	Field cFilterTags		:Int
'	Field hicon			:Int		'HICON
'	Field szShortName	:String'	[ACMDRIVERDETAILS_SHORTNAME_CHARS]	' char
'	Field szLongName	:String'	[ACMDRIVERDETAILS_LONGNAME_CHARS]	' char
'	Field szCopyright		:String'	[ACMDRIVERDETAILS_COPYRIGHT_CHARS] 	' char
'	Field szLicensing		:String'	[ACMDRIVERDETAILS_LICENSING_CHARS]	' char
'	Field szFeatures		:String'	[ACMDRIVERDETAILS_FEATURES_CHARS]	' char 	
'EndType

'Const  ACMDRIVERDETAILS_SHORTNAME_CHARS			= 32
'Const  ACMDRIVERDETAILS_LONGNAME_CHARS			= 128
'Const  ACMDRIVERDETAILS_COPYRIGHT_CHARS			= 80
'Const  ACMDRIVERDETAILS_LICENSING_CHARS			= 128
'Const  ACMDRIVERDETAILS_FEATURES_CHARS			= 512

'Type TacmFilterChoose
'	Field cbStruct		:Int		= SizeOf(TacmFilterChoose)
'	Field fdwStyle		:Int
'	Field hwndOwner		:Int
'	Field pwfltr		:Int		'LPWAVEFILTER 
'	Field cbwfltr		:Int
'	Field pszTitle		:String		'LPCSTR 
'	Field szFilterTag		:Int		[ACMFILTERTAGDETAILS_FILTERTAG_CHARS]
'	Field szFilter		:Int		[ACMFILTERDETAILS_FILTER_CHARS]
'	Field pszName		:String		'LPSTR 
'	Field cchName		:Int 
'	Field fdwEnum		:Int
'	Field pwfltrEnum		:Int		'LPWAVEFILTER
'	Field hInstance		:Int		'HINSTANCE 
'	Field pszTemplateName	:String		'LPCSTR 
'	Field lCustData		:Int		'LPARAM 
'	Field pfnHook		:Byte Ptr	'ACMFILTERCHOOSEHOOKPROC 
'EndType

'Type  TacmFilterDetails
'	Field cbStruct		:Int		= SizeOf(TacmFilterDetails)
'	Field dwFilterIndex	:Int
'	Field dwFilterTag		:Int
'	Field fdwSupport		:Int
'	Field pwfltr		:Int 		'LPWAVEFILTER  
'	Field cbwfltr		:Int 
'	Field szFilter		:Int		[ACMFILTERDETAILS_FILTER_CHARS]	' char 
'EndType
 
'Type TacmFilterTagDetails
'	Field cbStruct		:Int		= SizeOf(TacmFilterTagDetails)
'	Field dwFilterTagIndex	:Int
'	Field dwFilterTag		:Int
'	Field cbFilterSize		:Int
'	Field fdwSupport		:Int
'	Field cStandardFilters	:Int
'	Field szFilterTag		:Int		[ACMFILTERTAGDETAILS_FILTERTAG_CHARS] ' char
'EndType 

'Type TacmFormatChoose
'	Field cbStruct		:Int		= SizeOf(TacmFormatChoose)
'	Field fdwStyle		:Int
'	Field hwndOwner		:Int
'	Field pwfx		:Int 		'LPWAVEFORMATEX 
'	Field cbwfx		:Int
'	Field pszTitle		:String		'LPCSTR 
'	Field szFormatTag	:Int		[ACMFORMATTAGDETAILS_FORMATTAG_CHARS] ' char
'	Field szFormat		:Int		[ACMFORMATDETAILS_FORMAT_CHARS] ' char
'	Field pszName		:String		'LPSTR 
'	Field cchName		:Int
'	Field fdwEnum		:Int
'	Field pwfxEnum		:Int 		'LPWAVEFORMATEX 
'	Field hInstance		:Int		'HINSTANCE 
'	Field pszTemplateName	:String		'LPCSTR 
'	Field lCustData		:Int		'LPARAM 
'	Field pfnHook		:Byte Ptr	'ACMFORMATCHOOSEHOOKPROC 
'EndType

'Type TacmFormatDetails
'	Field cbStruct		:Int		= SizeOf(TacmFormatDetails)
'	Field dwFormatIndex	:Int
'	Field dwFormatTag	:Int
'	Field fdwSupport		:Int
'	Field pwfx		:Int		'LPWAVEFORMATEX 
'	Field cbwfx		:Int
'	Field szFormat		:Int		[ACMFORMATDETAILS_FORMAT_CHARS] ' char
'EndType 

'Type TacmFormatTagDetails
'	Field cbStruct			:Int		= SizeOf(TacmFormatTagDetails)
'	Field dwFormatTagIndex	:Int
'	Field dwFormatTag		:Int
'	Field cbFormatSize		:Int
'	Field fdwSupport			:Int
'	Field cStandardFormats	:Int
'	Field szFormatTag		:String	'[ACMFORMATTAGDETAILS_FORMATTAG_CHARS] ' char 
'EndType

'Type TacmStreamHeader
'	Field cbStruct		:Int		= SizeOf(TacmStreamHeader)
'	Field fdwStatus		:Int
'	Field dwUser		:Int Ptr		'DWORD_PTR
'	Field pbSrc		:Byte		'LPBYTE
'	Field cbSrcLength	:Int
'	Field cbSrcLengthUsed	:Int
'	Field dwSrcUser		:Int Ptr		'DWORD_PTR 
'	Field pbDst		:Byte		'LPByte
'	Field cbDstLength	:Int
'	Field cbDstLengthUsed	:Int
'	Field dwDstUser		:Int Ptr		'DWORD_PTR 
'	Field dwReservedDriver	:Int		[10]
'EndType

